package gzx.net
{
	import com.esri.ags.utils.DateUtil;
	
	/**
	 * 时间设置 
	 * @author konglw
	 * 
	 */
	public class CPartTimeSetOfPart
	{
		/**
		 * 时间段类型<br/>
		 * "normal" --开始时间，结束时间<br/>
		 * "point"  --单独时间点，存放在stime里面<br/>
		 * "segment" --在开始时间，结束时间范围圈定下的小时<br/>
		 */
		public var periodType:String = "normal";
		public var stime:Date;
		public var etime:Date;
		/** 查询附加条件<br/>
		 * 当periodType ="segment"时，存放如"9,10,11,20,21"等<br/>
		 * 其它不用的条件忽略此项<br/>
		 */
		public var optionStr:String;
		
		public function CPartTimeSetOfPart()
		{
		}
		
		public function cloneInstance():CPartTimeSetOfPart
		{
			var inst:CPartTimeSetOfPart = new CPartTimeSetOfPart();
			inst.periodType = this.periodType;
			inst.stime = this.stime;
			inst.etime = this.etime;
			inst.optionStr = this.optionStr;
			return inst;
		}
		public static function ParseFromJsonObj(jsonObj:Object):CPartTimeSetOfPart
		{
			var part:CPartTimeSetOfPart = new CPartTimeSetOfPart();
			part.periodType = jsonObj.periodType;
			var stimeNumber:Number = jsonObj.stime;
			part.stime = new Date();
			part.stime.time = stimeNumber;
			var etimeNumber:Number = jsonObj.etime;
			part.etime = new Date();
			part.etime.time = etimeNumber;
			part.optionStr = jsonObj.optionStr;
			return part;
		}
	}
}